import { lazy } from "react";
import {Navigate} from "react-router-dom";
import { 
    AppOutline,
    BankcardOutline,
    BillOutline,
    StarOutline,
    UserOutline
 } from 'antd-mobile-icons'
const Layout= lazy(()=>import('../pages/Layout'))
const Home= lazy(()=>import('../pages/Home'))
const My= lazy(()=>import('../pages/My'))
const Train= lazy(()=>import('../pages/Train'))
const Shop= lazy(()=>import('../pages/Shop'))
const Search= lazy(()=>import('../pages/Search'))
const Order= lazy(()=>import('../pages/Order'))
const Login= lazy(()=>import('../pages/Login'))
const City= lazy(()=>import('../pages/City'))
const Detail= lazy(()=>import('../pages/Detail'))



export const tabberRouter=[
    {
        path:"/home",
        meta:{
            title:"首页",
            icon:<AppOutline />

        },
        element:<Home />
    },
    {
        path:"/train",
        meta:{
            title:"定制旅行",
            icon:<BankcardOutline />

        },
        element:<Train />
    },
    {
        path:"/shop",
        meta:{
            title:"里程商城",
            icon:<BillOutline />

        },
        element:<Shop />
    },
    {
        path:"/order",
        meta:{
            title:"订单",
            icon:<StarOutline />    

        },
        element:<Order />
    },
    {
        path:"/my",
        meta:{
            title:"我的",
            icon:<UserOutline />

        },
        element:<My />
    }
]

const router=[
    {
        path:"/",
        element: <Layout />,
        children:[
            ...tabberRouter,
            {
                path:'/',
                element:<Navigate to="/home" />
            }
        ]
    },
    {
        path:'/search',
        element:<Search />
    },
    {
        path:'/login',
        element:<Login />
    },
    {
        path:'/city',
        element:<City />
    },
    {
        path:'/detail',
        element:<Detail />
    }

]

export default router